package com.foreveross.crawl.dto;

import java.io.Serializable;

/** 
 * @ClassName: 任务数据清单展示
 * @Description: TODO
 * @author luofangyi
 * @date 2014-7-11 下午6:11:16 
 *  
 */ 
public class TaskStatisticsDto implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 834027048144386762L;
	/**
	 * 渠道ID
	 */
	private Long channelId;
	/**
	 * 渠道名称
	 */
	private String channelName;
	/**
	 * 任务总数
	 */
	private int taskTotal;
	
	/**
	 * 执行中的任务数
	 */
	private int taskDoing;
	
	/**
	 * 执行异常任务数
	 */
	private int taskException;
	
	/**
	 * 成功的任务数
	 */
	private int taskSuccess;
	
	/**
	 * 成功率
	 */
	private String successRates;

	public int getTaskTotal() {
		return taskTotal;
	}

	public void setTaskTotal(int taskTotal) {
		this.taskTotal = taskTotal;
	}

	public int getTaskDoing() {
		return taskDoing;
	}

	public void setTaskDoing(int taskDoing) {
		this.taskDoing = taskDoing;
	}

	public int getTaskException() {
		return taskException;
	}

	public void setTaskException(int taskException) {
		this.taskException = taskException;
	}

	public int getTaskSuccess() {
		return taskSuccess;
	}

	public void setTaskSuccess(int taskSuccess) {
		this.taskSuccess = taskSuccess;
	}

	

	public Long getChannelId() {
		return channelId;
	}

	public void setChannelId(Long channelId) {
		this.channelId = channelId;
	}

	public String getChannelName() {
		return channelName;
	}

	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}

	public String getSuccessRates() {
		return successRates;
	}

	public void setSuccessRates(String successRates) {
		this.successRates = successRates;
	}

	@Override
	public String toString() {
		return "TaskStatisticsDto [channelId=" + channelId + ", channelName="
				+ channelName + ", taskTotal=" + taskTotal + ", taskDoing="
				+ taskDoing + ", taskException=" + taskException
				+ ", taskSuccess=" + taskSuccess + ", successRates="
				+ successRates + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((channelId == null) ? 0 : channelId.hashCode());
		result = prime * result
				+ ((channelName == null) ? 0 : channelName.hashCode());
		result = prime * result
				+ ((successRates == null) ? 0 : successRates.hashCode());
		result = prime * result + taskDoing;
		result = prime * result + taskException;
		result = prime * result + taskSuccess;
		result = prime * result + taskTotal;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TaskStatisticsDto other = (TaskStatisticsDto) obj;
		if (channelId == null) {
			if (other.channelId != null)
				return false;
		} else if (!channelId.equals(other.channelId))
			return false;
		if (channelName == null) {
			if (other.channelName != null)
				return false;
		} else if (!channelName.equals(other.channelName))
			return false;
		if (successRates == null) {
			if (other.successRates != null)
				return false;
		} else if (!successRates.equals(other.successRates))
			return false;
		if (taskDoing != other.taskDoing)
			return false;
		if (taskException != other.taskException)
			return false;
		if (taskSuccess != other.taskSuccess)
			return false;
		if (taskTotal != other.taskTotal)
			return false;
		return true;
	}


}
